Skip to content

Fix deadline enforcement: check has_deadline, use block timestamp#810

Merged
realproject7 merged 1 commit intomainfrom
task/808-deadline-has-deadline-fix
Apr 3, 2026
Merged

Fix deadline enforcement: check has_deadline, use block timestamp#810
realproject7 merged 1 commit intomainfrom
task/808-deadline-has-deadline-fix

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

Critical fix: PR #807's deadline enforcement was incorrectly blocking storylines with has_deadline=false.

Bug 1 Fix: has_deadline check added

  • AddPlotButton.tsx: skips deadline check when hasDeadline is false
  • create/page.tsx: isStorylineExpired() checks s.has_deadline before time comparison
  • api/index/plot/route.ts: selects has_deadline, skips deadline check when false

Bug 2 Fix: Block timestamp instead of Date.now()

  • API indexer now compares blockTimestamp (when tx was mined) vs deadline, not Date.now() — prevents rejecting plots the contract already accepted near the deadline edge

Test Plan

  • Storyline with has_deadline=false: button clickable, dropdown selectable, API accepts
  • Storyline with has_deadline=true + expired: button disabled, dropdown disabled, API rejects
  • Storyline with has_deadline=true + active: all works normally
  • Sunset storyline: disabled state in all locations

Fixes #808

🤖 Generated with Claude Code

Critical: deadline logic was incorrectly blocking storylines without
deadlines (has_deadline=false).

1. AddPlotButton: skip deadline check when hasDeadline is false
2. Create page: isStorylineExpired checks has_deadline before time check
3. API indexer: select has_deadline, skip check when false; use block
   timestamp instead of Date.now() to avoid rejecting plots the
   contract already accepted near the deadline edge

Fixes #808

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Apr 3, 2026 1:41pm

Request Review

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The PR fixes both deadline-regression paths from issue #808. The has_deadline gate is now applied consistently in the button, create flow, and API, and the API deadline check now compares against the transaction's block timestamp instead of wall-clock time.

Findings

  • No blocking findings.

Decision

Approving. This satisfies the critical acceptance criteria for issue #808 and removes the false blocking introduced by PR #807.

@realproject7 realproject7 merged commit 8f17f8c into main Apr 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Deadline enforcement: missing has_deadline check + API uses wrong timestamp

2 participants